<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            list-style:none;
        }
        #e_coder{
            width: 50px;
            height: 50px;
            background: url("2.jpg"), no-repeat;
            position: fixed;
            left: 0;
            top: 40%;
            cursor: pointer ;


        }
        #e_app{
            position: absolute;
            left: 50px;
            top: -50px;
            display: none;//hidden

        }
    </style>
</head>
<body>
<div id="e_coder">
    <div id="e_app">
        <img src="4.jpg" alt="公众号" style="width: 150px">
    </div>
</div>

<script>
window.onload = function () {
    //get element
    var e_coder = document.getElementById("e_coder");
    var e_app = document.getElementById("e_app");

    //监听鼠标进入
    e_coder.onmouseover = function () {

        //1-改变背景图片
        this.style.background ='url("3.jpg") ,no-repeat' ;
        //2-显示隐藏的二维码
        e_app.style.display = 'block';


    };
    //鼠标离开
    e_coder.onmouseout = function () {
        //1-改变背景图片
        this.style.background ='url("2.jpg"), no-repeat' ;
        //2-显示隐藏的二维码
        e_app.style.display = 'none';
    }


}
</script>
</body>
</html>